package cn.itsource.basic.service.impl;

import cn.itsource.basic.service.IBaiduAiAuditService;
import cn.itsource.basic.util.BaiduAuditUtils;
import org.springframework.stereotype.Service;

@Service
public class BaiduAiAuditSserviceImpl implements IBaiduAiAuditService {
    @Override
    public Boolean textAudit(String text) {
        return BaiduAuditUtils.TextCensor(text);
//        return true;
    }

    @Override
    public Boolean imageAudit(String resources) {
//        return BaiduAuditUtils.ImgCensor(resources);
        if(resources==null){
            return true;
        }
        String[] split = resources.split(",");
        for (String s : split) {
            if(BaiduAuditUtils.ImgCensor("http://123.207.27.208"+s)){
                return false;
            }
        }
        return true;
    }
}
